#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n;
	scanf("%d", &n);
	if (n < 5 || n > 10)
	{
		printf("Error Input");
		return 0;
	}

	int sum = 0;
	int temp = 6;
	while (n > 0)
	{
		sum = sum + temp;
		temp = temp * 10 + 6;
		n--;
	}
	printf("sum=%d", sum);
	return 0;
}


#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	if (n < 5 || n > 10) {
		printf("Error Input");
		return 0;
	}
	int sum = 0;
	int temp = 6;
	for (int i = 1; i <= n; i++) {
		sum += temp;
		temp = temp * 10 + 6;
	}
	printf("sum=%d", sum);
	return 0;
}